package com.allwees.bs.module.oms.rest;

import com.allwees.bs.module.core.annotation.PrintLog;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.allwees.bs.core.modelbase.vo.R;
import com.allwees.bs.module.core.dynamic.annotation.DynamicInject;
import com.allwees.bs.module.oms.entity.OmsOrder;
import com.allwees.bs.module.oms.req.query.OmsOrderQueryReq;
import com.allwees.bs.module.oms.service.GeneralOmsOrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 通用订单api
 *
 * @author mouhaining
 * @since 2020-03-02 14:04
 */
@PrintLog
@RestController
@RequestMapping("/backstage/api/oms/oms_order")
public class GeneralOmsOrderApi extends BaseOmsOrderApi<GeneralOmsOrderService> {



    @GetMapping("/page")
    @DynamicInject(key = "userUuid",type= DynamicInject.Type.User)
    public R page(Page<OmsOrder> page, OmsOrderQueryReq req) {
        return super.page(page, req);
    }

    @PostMapping("/early_sync/{orderUuid}")
    public R earlySync(@PathVariable String orderUuid) {
        boService.create(orderUuid);
        return R.ok();
    }
}
